package cn.ddiancan.schedule.base.service.impl;

import cn.ddiancan.schedule.base.dao.ITaskTimerLogDao;
import cn.ddiancan.schedule.base.domain.TaskLogVO;
import cn.ddiancan.schedule.base.service.ITaskTimerLogService;
import cn.ddiancan.xddcloud.ddccore.request.PageRequest;
import cn.ddiancan.xddcloud.ddccore.response.PagedResultListInfo;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TaskTimerLogService implements ITaskTimerLogService {
    @Autowired
    private ITaskTimerLogDao taskTimerLogDao;

    @Override
    public void addTaskTimerLog(TaskLogVO taskLogVO) {
        taskTimerLogDao.addTaskTimerLog(taskLogVO);
    }

    @Override
    public PagedResultListInfo<TaskLogVO> getTaskTimerLogList(PageRequest<TaskLogVO> pageRequest) {
        PageHelper.startPage(pageRequest.getPageNo(), pageRequest.getPageSize());
        List<TaskLogVO> taskTimerLogList = taskTimerLogDao.getTaskTimerLogList(pageRequest.getEntity());
        return new PagedResultListInfo<>(pageRequest.getPageNo(),pageRequest.getPageSize(),taskTimerLogList);
    }
}
